<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules//vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">

        <button v-on:click="num++">点赞</button>
        <button v-on:click="num--">取消</button>
        <button @click="cancle">取消</button>
        <h1>有{{num}}</h1>

        <div style="border: 1px solid red; padding: 20px;" @click.once="hello">
            <div style="border: 1px solid rgb(41, 14, 14); padding: 20px;" ><a href="http://baidu.com">百度</a></div>
        </div>

        <input type="text" name="" id="" v-model="num" v-on:keyup.17="num+=10">
        <input type="text" name="" id="" v-model="num" v-on:keyup.down="num-=2">
    </div>  
    <script>
        new Vue({
            el: "#app",
            data: {
                num: 1
            },
            methods: {
                cancle() {
                    this.num--;
                }, hello() {
                    alert("点击了")
                }


            }
        })
    </script>

</body>

</html>